package cn.cvs.dao;

import cn.cvs.pojo.StorageRecord;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StroageRecordMapper {
    /**
     * 分页查询
     *
     * @return
     * @throws Exception
     */
    List<StorageRecord> queryAllStroageList(@Param("queryGoodsName") String queryGoodsName, @Param("querySupplierId") Integer querySupplierId
            , @Param("queryPayStatus") Integer queryPayStatus, @Param("pageIndex") Integer pageIndex
            , @Param("pageSize") Integer pageSize) throws Exception;

    /**
     * 查询入库总记录数
     *
     * @param queryGoodsName
     * @param querySupplierId
     * @param querypayStatus
     * @return
     * @throws Exception
     */
    int queryCount(@Param("queryGoodsName") String queryGoodsName, @Param("querySupplierId") Integer querySupplierId
            , @Param("querypayStatus") Integer querypayStatus) throws Exception;

    /**
     * 新增入库记录
     *
     * @param storageRecord
     * @return
     * @throws Exception
     */
    int insertStorageRecord(StorageRecord storageRecord) throws Exception;

    /**
     * 修改入库记录
     *
     * @param storageRecord
     * @return
     * @throws Exception
     */
    int modifyStorageRecord(StorageRecord storageRecord) throws Exception;

    /**
     * 通过id查询入库记录
     *
     * @param id
     * @return
     * @throws Exception
     */
    StorageRecord queryStorageRecordById(@Param("id") Integer id) throws Exception;

    /**
     * 删除入库信息
     *
     * @param id
     * @return
     * @throws Exception
     */
    Integer delStorageRecordById(@Param("id") Integer id) throws Exception;

    /**
     * 获取供应商写的入库数量
     *
     * @param id
     * @return
     * @throws Exception
     */
    List findStorageRecordBySupplierId(@Param("id") Integer id) throws Exception;
}

